﻿using NetCore.Dtos;
using System.Collections.Generic;

namespace NetCore.EnumServices
{
    /// <summary>
    /// 枚举类型专用Service
    /// </summary>
    public class EnumAppService : NetCoreAppServiceBase, IEnumAppService
    {
        /// <summary>
        /// 返回系统所有枚举类型 类型名称->类型描述/全名
        /// </summary>
        /// <returns></returns>
        public IEnumerable<KeyValueDto<string, string>> GetAllEnumTypeNames()
        {
            return EnumContext.Instance.GetAllEnumTypeNames();
        }

        #region 获取 枚举项集合 EnumTypeItemKeyNameDescriptions 返回给上端可组织任意返回数据格式
        /// <summary>
        /// 获取 枚举项集合 EnumTypeItemKeyNameDescriptions
        /// </summary>
        /// <param name="input">枚举类型名称</param>
        /// <returns></returns>
        public List<EnumTypeItemDto> GetEnumTypeItemKeyNameDescriptions(InputNameDto input)
        {
            return EnumContext.Instance.GetEnumTypeItemKeyNameDescriptions(input);//GeTypeByName(input.Name)
        }
        #endregion

        #region 以下接口注释 可以通过上面的接口select得到以下接口数据 


        //#region 获取枚举类型 EnumKey(枚举整型值)-->EnumItemString(枚举值字符串)-->EnumKey(枚举整型值)

        ///// <summary>
        ///// 获取枚举项值ItemKey-->枚举值字符串ItemStringName [ 0->"male",10->"female"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto> GetEnumItemKeyToItemStringName(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemKeyToItemStringName(input);
        //}

        ///// <summary>
        ///// 获取枚举项值字符串ItemKeyString-->枚举值字符串ItemStringName ["0"->"male","10"->"female"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemKeyStringToItemStringName(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemKeyStringToItemStringName(input);
        //}

        ///// <summary>
        ///// 获取枚举项(字符串)ItemStringName--ItemKey(枚举整型值)  ["male"->0,"female"->10]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, int>> GetEnumItemStringNameToItemKey(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemStringNameToItemKey(input);
        //}
        ///// <summary>
        ///// 获取枚举项(字符串)ItemStringName--ItemKeyString(枚举整型值字符串)   ["male"->"0","female"->"10"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemStringNameToItemKeyString(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemStringNameToItemKeyString(input);
        //}
        //#endregion

        //#region 获取枚举类型 EnumKey(枚举整型值)-->EnumItemDescription(描述)/EnumItemString(枚举值字符串)-->EnumKey(枚举整型值)

        ///// <summary>
        ///// 获取枚举项值ItemKey-->枚举值字符串ItemDescription  [ 0->"男",10->"女"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto> GetEnumItemKeyToItemDescription(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemKeyToItemDescription(input);
        //}
        ///// <summary>
        ///// 获取枚举项值字符串ItemKeyString-->枚举值字符串ItemDescription [ "0"->"男","10"->"女"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumKeyStringToItemDescription(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumKeyStringToItemDescription(input);
        //}

        ///// <summary>
        ///// 获取枚举项描述ItemDescription--ItemKey(枚举整型值) [ "男->0,"女"->10]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, int>> GetEnumItemDescriptionToItemKey(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemDescriptionToItemKey(input);
        //}
        ///// <summary>
        ///// 获取枚举项描述ItemDescription--ItemKeyString(枚举整型值字符串) [ "男->"0","女"->"10"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemDescriptionToItemKeyString(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemDescriptionToItemKeyString(input);
        //}
        //#endregion

        //#region 获取枚举类型 EnumKey(枚举整型值)-->获取枚举类型 EnumItemDescription/EnumItemString(描述/枚举值字符串)-->EnumKey(枚举整型值)

        ///// <summary>
        ///// 获取枚举项值ItemKey--> ItemDescriptionOrName(描述/枚举值字符串) [ 0->"男??male"->,10->"女??female"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto> GetEnumItemKeyToItemDescriptionOrName(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemKeyToItemDescriptionOrName(input);
        //}
        ///// <summary>
        ///// 获取枚举项值ItemKeyString-->ItemDescriptionOrName(描述/枚举值字符串) [ "0"->"男??male"->,"10"->"女??female"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemKeyStringToItemDescriptionOrName(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemKeyStringToItemDescriptionOrName(input);
        //}

        ///// <summary>
        ///// ItemDescriptionOrName(描述/枚举值字符串)-->ItemKey(枚举整型值) [ "男??male"->0,"女??female"=>10]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, int>> GetEnumItemDescriptionOrNameToItemKey(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemDescriptionOrNameToItemKey(input);
        //}
        ///// <summary>
        ///// ItemDescriptionOrName(描述/枚举值字符串)-->ItemKeyString(枚举整型值字符串) [ "男??male"->"0","女??female"->"10"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemDescriptionOrNameToItemKeyString(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemDescriptionOrNameToItemKeyString(input);
        //}
        //#endregion

        //#region 获取枚举类型 EnumItemString(枚举值字符串)-->EnumItemDescription(描述)-->EnumItemString(枚举值字符串)

        ///// <summary>
        ///// 获取枚举项ItemStringName--> ItemDescription(描述) [ "male"->"男","female"->"女"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemStringNameToItemDescription(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemStringNameToItemDescription(input);
        //}
        ///// <summary>
        ///// 获取枚举项描述ItemDescription--> ItemStringName(枚举项字符串)  [ "男"->"male","女"->"female"]列表
        ///// </summary>
        ///// <param name="input">枚举类型名称</param>
        ///// <returns></returns>
        //public List<KeyValueDto<string, string>> GetEnumItemDescriptionToItemStringName(InputNameDto input)
        //{
        //    return EnumContext.Instance.GetEnumItemDescriptionToItemStringName(input);
        //}

        //#endregion



        #endregion

    }
}
